package com.epalmpay.service.spot;

import com.epalmpay.dto.order.OrderInDTO;
import com.epalmpay.entity.RefundPassword;
import com.epalmpay.entity.Ticket;
import com.epalmpay.entity.TradeOffline;
import com.epalmpay.exception.ApplicationException;
import com.epalmpay.util.Response;

import java.text.ParseException;
import java.util.List;

/**
 * Created by Administrator on 2018/1/24.
 */
public interface ISpotService {

    /**
     * 根据商圈号获取门票类型
     * @param ticket
     * @return
     */
    List<Ticket> selectTicketsByGroupId(Ticket ticket);

    /**
     * 添加门票类型
     * @param ticket
     * @return
     */
    int insertTicket(Ticket ticket);

    /**
     * 根据编号查询门票类型详情
     * @param ticket
     * @return
     */
    Ticket selectTicketById(Ticket ticket);

    /**
     * 更新门票类型
     * @param ticket
     * @return
     */
    int updateTicket(Ticket ticket);

    /**
     * 删除门票类型
     * @param ticket
     * @return
     */
    int deleteTicket(Ticket ticket);

    /**
     * 根据名称查询门票类型
     * @param ticket
     * @return
     */
    Ticket selectTicketByName(Ticket ticket);

    /**
     * 插入门票交易记录
     * @param to
     */
    void insertTicketTrade(TradeOffline to);

    Boolean saveSpotData(OrderInDTO orderInDTO) throws ApplicationException;

    //门票核销
    Response couponVerify(String couponCode) throws ApplicationException, ParseException;;

    /**
     * 生成门票码
     */
    //void generateTicketDetail();

    /**
     * 门票退款
     * @param to
     */
    void updateRefundTicket(TradeOffline to) throws Exception;

    /**
     * 更新退款密码
     * @param rp
     */
    void updateRefundPassword(RefundPassword rp);

    /**
     * 查询密码是否正确
     * @param rp
     * @return
     */
    RefundPassword selectRefundById(RefundPassword rp);

}
